package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Channel;
import net.betou.trade.entity.main.Content;

public abstract class BaseContent implements Serializable{

	
	private static final long serialVersionUID = 3624909468442728628L;

	// constructors
	public BaseContent( ) {
		initialize( );
	}

	/**
	 * Constructor for primary key
	 */
	public BaseContent( java.lang.Integer id ) {
		this.setId( id );
		initialize( );
	}

	protected void initialize( ) {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private Integer id;
	
	private Date pubDate;    // 发布时间
	private String title;        // 标题
	private String content;   // 内容
	private Boolean recommend;  // 是否推荐
	private String description;   // 简介信息
	private Boolean created;  // 是否创建静态页面
	
	private Boolean send; // 是否发送短信

	private Channel channel;
	private AgentAndAdmins admin; // 所属用户
	
	

	/**
	 * Return the unique identifier of this class
	 * 
	 * @hibernate.id generator-class="identity" column="content_id"
	 */
	public java.lang.Integer getId( ) {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId( java.lang.Integer id ) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	

	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof Content ) )
			return false;
		else{
			Content content = ( Content ) obj;
			if( null == this.getId( ) || null == content.getId( ) )
				return false;
			else
				return( this.getId( ).equals( content.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}

	public String toString( ) {
		return super.toString( );
	}

	public Date getPubDate( ) {
		return pubDate;
	}

	public void setPubDate( Date pubDate ) {
		this.pubDate = pubDate;
	}

	public String getTitle( ) {
		return title;
	}

	public void setTitle( String title ) {
		this.title = title;
	}

	public String getContent( ) {
		return content;
	}

	public void setContent( String content ) {
		this.content = content;
	}

	public Boolean getRecommend( ) {
		return recommend;
	}

	public void setRecommend( Boolean recommend ) {
		this.recommend = recommend;
	}

	public String getDescription( ) {
		return description;
	}

	public void setDescription( String description ) {
		this.description = description;
	}

	public Channel getChannel( ) {
		return channel;
	}

	public void setChannel( Channel channel ) {
		this.channel = channel;
	}

	public AgentAndAdmins getAdmin( ) {
		return admin;
	}

	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}

	public Boolean getCreated() {
		return created;
	}

	public void setCreated(Boolean created) {
		this.created = created;
	}

	public Boolean getSend( ) {
		return send;
	}

	public void setSend( Boolean send ) {
		this.send = send;
	}
	
	
}